package com.example.module_service.merchant

import android.os.Bundle
import android.widget.TextView
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.example.lib_common.view.view.BaseMvvmActivity
import com.example.module_service.R
import com.example.module_service.databinding.ActivityMerchantDetailBinding
import com.example.module_service.entity.MerchantEntityItem
import dagger.hilt.android.AndroidEntryPoint
/**
 * //企业详情
 */
@AndroidEntryPoint
@Route(path = "/module_service/MerchantDetailActivity")
class MerchantDetailActivity : BaseMvvmActivity<ActivityMerchantDetailBinding>() {
    @Autowired
    lateinit var merchant:MerchantEntityItem

    override fun getLayoutId(): Int =R.layout.activity_merchant_detail

    override fun initViews() {
       ARouter.getInstance().inject(this)

        binding.merchantName.text=merchant.name
        binding.merchantType.text=merchant.industryType
        binding.merchantAddress.text=merchant.address
        binding.merchantNameNames.text=merchant.legalRepresentative
        binding.merchantPhone.text=merchant.contactInfo
        binding.merchantStatus.text=merchant.status

        val byId = findViewById<TextView>(R.id.merchant_boolean)
        if (merchant.listed==true){
            binding.merchantBoolean.text="是"
        }else{
            binding.merchantBoolean.text="否"
        }
       // binding.merchantBoolean.text="${merchant.listed}"
        binding.merchantGpName.text=merchant.stockName
        binding.merchantGpDm.text=merchant.stockCode

    }

    override fun getActivityState(state: Bundle) {
        TODO("Not yet implemented")
    }

    override fun saveActivityState(outState: Bundle) {
        TODO("Not yet implemented")
    }

}